package chapter09;

public class HumanTest {
    public static void main(String[] args) {


        System.out.println("-----正常方法调用-----");

        Northerner h1 = new Northerner();
        h1.eat();
        h1.StewedVegetables();
        h1.SteamedBuns();
        System.out.println();

        Southerner h2 = new Southerner();
        h2.eat();
        h2.FriedVegetables();
        h2.Rice();

        System.out.println("-----多态方法调用-----");
        Human h3 = new Northerner();
        h3.eat();
        Human h4 = new Southerner();
        h4.eat();
        System.out.println();

        Northerner h5 = (Northerner) h3;
        h5.eat();
        h5.StewedVegetables();
        h5.SteamedBuns();
        System.out.println();

        Southerner h6 = (Southerner) h4;
        h6.eat();
        h6.FriedVegetables();
        h6.Rice();
    }
}